import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.2

ApplicationWindow {
    width: 400;
    height: 200;
    id: window;
    visible: true;
    property var aboutDlg: null;
    menuBar: MenuBar {
        Menu {
            title: "help";
            MenuItem {
                text: "about";
                onTriggered: window.showAbout();
            }
            MenuItem {
                text: "connect acthor";
            }
        }
    }
    function showAbout() {
        if (aboutDlg === null) {
            aboutDlg = Qt.createQmlObject('import QtQuick.Dialogs 1.1;MessageDialog{icon:StandardIcon.Information;title:"about";
text: "only a example"; standardButtons:StandardButton.Ok;}', window, "aboutDlg");
            aboutDlg.accepted.connect(onAboutDlgClosed);
            aboutDlg.rejected.connect(onAboutDlgClosed);
            aboutDlg.visible = true;
        }
    }
    function onAboutDlgClosed() {
        aboutDlg.destroy();
        aboutDlg = null;
    }
}

